
var but = document.getElementById("add");
var _channel = document.getElementById("channel");
var _name = document.getElementById("name");

but.onclick = function(){
    data = {
        "type":1,
        "data":[{
            "freq":_channel.value,
            "name":_name.value
        }]
    }
    content = JSON.stringify(data);
    $.ajax({
        url:"/d/whitelist/1",
        type:"POST",
        dataType:"text",
        data:content,
        success:function(data){
            var CODE = JSON.parse(data);
            alert(CODE["errmsg"]);
        },
        error:function(XMLHttpRequest){
            alert(XMLHttpRequest.status)
        }
    });
}
